package cn.mxz.controller;

import cn.mxz.pojo.ResultData;
import cn.mxz.service.impl.ProductServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 作者；朱洪旭
 * 时间；2021/12/3 17:28
 */
@RestController
@RequestMapping("/requestlist")
@CrossOrigin
public class ProductController {
    @Autowired
    private ProductServiceImpl productService;
    @GetMapping
    public ResultData selectrequest(Integer cid){
       return productService.getProductbycategoryid(cid);
    }
    //根据产品ID查询规格信息
    @GetMapping("{productId}")
    public ResultData selectSkuByProductId(@PathVariable String productId){
        return productService.selectSkuById(productId);
    }
    @GetMapping("/msg")
    public ResultData selectreuestbylike(String msg){
        ResultData getprdlike = productService.getprdlike(msg);
        return  getprdlike;
    }
}
